function loginSubmit() {
	var email = $('#login_popup #email').val();
	var pass = $('#login_popup #pass').val();
        var formFrror = '';
        formFrror += email==""?"Please enter email\n":"";
        formFrror += pass==""?"Please enter password\n":"";
        if(formFrror!=""){
            alert(formFrror);return false;
        }
	var param = {'email':email, 'pass':pass};
	$.post("../ajaxlogin", param, function(error){
		if(error=='0') {
                        window.location = "edit_profile.jsp";
		} else {                    
                    alert(error);
		}
	}, "text");		
}
$(document).ready(function() {
        $(".closable").append('<a href="#" class="close">close</a>');
        // Close the notifications when the close link is clicked
        $("a.close").click(function () {
                $(this).fadeTo(200, 0); // This is a hack so that the close link fades out in IE
                $(this).parent().fadeTo(200, 0);
                $(this).parent().slideUp(400);
                return false;
        });
        // Fade in the notifications
        $(".notification").fadeIn("slow");
	$("a#login_link").fancybox();
        $('#login_form').submit(function(){
            loginSubmit();
            return false;
        });
});